home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 5 / Apprentice-Release5.iso / Source Code / Libraries / DCLAP 6d / dclap6d / network / apple.old / MacTCPCommonTypes.h < prev    next >
Text File  |  1996-07-05  |  3KB  |  108 lines

  1. /* 
  2.     MacTCPCommonTypes.h  
  3.     C type definitions used throughout MacTCP.
  4.                         
  5.     Copyright Apple Computer, Inc. 1988 
  6.     All rights reserved
  7.     
  8. */
  9.  
  10. #ifndef __TYPES__
  11. #include <Types.h>
  12. #endif /* __TYPES__ */
  13.  
  14. /* MacTCP return Codes in the range -23000 through -23049 */
  15. #define inProgress                1                /* I/O in progress */
  16.  
  17. #define ipBadLapErr                -23000            /* bad network configuration */
  18. #define ipBadCnfgErr            -23001            /* bad IP configuration error */
  19. #define ipNoCnfgErr                -23002            /* missing IP or LAP configuration error */
  20. #define ipLoadErr                -23003            /* error in MacTCP load */
  21. #define ipBadAddr                -23004            /* error in getting address */
  22. #define connectionClosing        -23005            /* connection is closing */
  23. #define invalidLength            -23006
  24. #define connectionExists        -23007            /* request conflicts with existing connection */
  25. #define connectionDoesntExist    -23008            /* connection does not exist */
  26. #define insufficientResources    -23009            /* insufficient resources to perform request */
  27. #define invalidStreamPtr        -23010
  28. #define streamAlreadyOpen        -23011
  29. #define connectionTerminated    -23012
  30. #define invalidBufPtr            -23013
  31. #define invalidRDS                -23014
  32. #define invalidWDS                -23014
  33. #define openFailed                -23015
  34. #define commandTimeout            -23016
  35. #define duplicateSocket            -23017
  36.  
  37. /* Error codes from internal IP functions */
  38. #define ipDontFragErr            -23032            /* Packet too large to send w/o fragmenting */
  39. #define ipDestDeadErr            -23033            /* destination not responding */
  40. #define ipNoFragMemErr            -23036            /* no memory to send fragmented pkt */
  41. #define ipRouteErr                -23037            /* can't route packet off-net */
  42.  
  43. #define nameSyntaxErr             -23041        
  44. #define cacheFault                -23042
  45. #define noResultProc            -23043
  46. #define noNameServer            -23044
  47. #define authNameErr                -23045
  48. #define noAnsErr                -23046
  49. #define dnrErr                    -23047
  50. #define    outOfMemory                -23048
  51.  
  52. #define BYTES_16WORD               2                /* bytes per 16 bit ip word */
  53. #define BYTES_32WORD            4                /* bytes per 32 bit ip word */
  54. #define BYTES_64WORD            8                /* bytes per 64 bit ip word */
  55.  
  56. typedef unsigned char b_8;                /* 8-bit quantity */
  57. typedef unsigned short b_16;            /* 16-bit quantity */
  58. typedef unsigned long b_32;                /* 32-bit quantity */
  59.  
  60. typedef b_32 ip_addr;                    /* IP address is 32-bits */
  61.  
  62. typedef struct ip_addrbytes {
  63.     union {
  64.         b_32 addr;
  65.         char byte[4];
  66.         } a;
  67.     } ip_addrbytes;
  68.     
  69. typedef struct wdsEntry {
  70.     unsigned short    length;                        /* length of buffer */
  71.     char *    ptr;                        /* pointer to buffer */
  72.     } wdsEntry;
  73.  
  74. typedef struct rdsEntry {
  75.     unsigned short    length;                        /* length of buffer */
  76.     char *    ptr;                        /* pointer to buffer */
  77.     } rdsEntry;
  78.  
  79. typedef unsigned long BufferPtr;
  80.  
  81. typedef unsigned long StreamPtr;
  82.  
  83. typedef enum ICMPMsgType {
  84.     netUnreach, hostUnreach, protocolUnreach, portUnreach, fragReqd,
  85.     sourceRouteFailed, timeExceeded, parmProblem, missingOption,
  86.     lastICMPMsgType = 65535
  87.     } ICMPMsgType;
  88.     
  89. typedef b_16 ip_port;
  90.  
  91. typedef struct ICMPReport {
  92.     StreamPtr streamPtr;
  93.     ip_addr localHost;
  94.     ip_port localPort;
  95.     ip_addr remoteHost;
  96.     ip_port remotePort;
  97.     enum ICMPMsgType reportType;
  98.     unsigned short optionalAddlInfo;
  99.     unsigned long optionalAddlInfoPtr;
  100.     } ICMPReport;
  101.     
  102.  
  103. typedef OSErr (*OSErrProcPtr)();
  104. typedef Ptr (*PtrProcPtr)();
  105. typedef Boolean (*BooleanProcPtr)();
  106. typedef void (*voidProcPtr)();
  107.  
  108.